package com.ucode.model.hrm.form;

import com.ucode.model.hrm.HrmSocialSecurityRuleItem;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDate;
import java.util.List;

/**
 * 社保规则
 * @Author: liliang
 * @Date: 2025/6/7 14:41
 * @Version: 1.0
 */
@Schema(description = "人力资源管理系统 - 社保规则Form")
@Data
@EqualsAndHashCode
@ToString(callSuper = true)
public class HrmSocialSecurityRuleForm {
    /**
     * 规则名称
     */
    @Schema(description = "规则名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "规则名称不能为空")
    @Size(max = 100, message = "规则名称不能超过 100 个字符")
    private String name;
    /**
     * 使用地区
     */
    @Schema(description = "使用地区", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "使用地区不能为空")
    @Size(max = 100, message = "使用地区不能超过 100 个字符")
    private String useRegion;
    /**
     * 生效日期
     */
    @Schema(description = "生效日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "生效日期不能为空")
    private LocalDate effectiveDate ;
    /**
     * 规则明细
     */
    @Schema(description = "规则明细", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "规则明细不能为null")
    private List<@Valid  HrmSocialSecurityRuleItem> items;
    /**
     * 备注
     */
    @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
    @Size(max = 255, message = "备注不能超过 255 个字符")
    private String remark;
}
